#include "Support.h"
#include "StateManager.h"
#include "Game.h"

void CGame::Run()
{
	while (true)
	{
		//Make sure FPS is approximate 30
		if (GIsElapsed(1000 / 30))
		{
			GClearBuffer();

			//Update and draw current state
			CStateManager::GetInstance()->GetListState().back()->Update();
			CStateManager::GetInstance()->GetListState().back()->Draw();

			GFlushBuffer();
		}
	}
}
